# name : macro all combination of vars for one dt
# key : macro.all.combin.vars
# contributor: Shuguang Sun
# --
proc sql;
  create table _$1._stat as
    select DISTINCT
    %if %nrbquote(&groupby.) ne %then %do;
    a.&groupby.,
      %end;
    a.&group., b._ord, b.statistic
      from ${1:_&dtout.} (KEEP = &groupby. &group.) as a, $1 (KEEP = _ord statistic) as b
      order BY %if %nrbquote(&groupby.) ne %then %do;
      &groupby.,
        %end;
      &group., _ord;
      quit;
run;
